# -*- encoding: utf-8 -*-
__author__ = 'rsj217'


from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
from views import CategoryAddView, CategoryListView, CategoryDetailView, CategoryUpdateView, CategoryDeleteView,\
    ContactKeeperAddView, ContactKeeperListView, ContactKeeperDetailView, ContactKeeperUpdateView, \
    ContactKeeperDeleteView, ContactManagerAddView, ContactManagerListView



urlpatterns = patterns('',


     url(r'^category/list$', login_required(CategoryListView.as_view()), name='category-list'),
     url(r'^category/add/$', login_required(CategoryAddView.as_view()), name='category-add'),
     url(r'^category/(?P<pk>\d+)/$', login_required(CategoryDetailView.as_view()), name='category-detail'),
     url(r'^category/(?P<pk>\d+)/update', login_required(CategoryUpdateView.as_view()), name='category-update'),
     url(r'^category/(?P<pk>\d+)/delete', login_required(CategoryDeleteView.as_view()), name='category-delete'),

     url(r'^contactkeeper/add/$', login_required(ContactKeeperAddView.as_view()), name='contactkeeper-add'),
     url(r'^contactkeeper/list/$', login_required(ContactKeeperListView.as_view()), name='contactkeeper-list'),
     url(r'^contactkeeper/(?P<pk>\d+)/detail/$',
         login_required(ContactKeeperDetailView.as_view()), name='contactkeeper-detail'),
     url(r'^contactkeeper/(?P<pk>\d+)/update/$',
         login_required(ContactKeeperUpdateView.as_view()), name='contactkeeper-update'),
     url(r'^contactkeeper/(?P<pk>\d+)/delete/$',
         login_required(ContactKeeperDeleteView.as_view()), name='contactkeeper-delete'),

     url(r'^contactmanager/add/(?P<pk>\d+)/(?P<username>\w+)/$',
         login_required(ContactManagerAddView.as_view()), name="contactmanager-add"),
     url(r'^contactmanager/list/(?P<category_id>\d+)/$',
         login_required(ContactManagerListView.as_view()), name="contactmanager-list")
)
